package operation;

import book.Book;
import book.bookList;

import java.util.Scanner;

public class FIndoperation implements Listoperation{
    @Override
    public void work(bookList booklist) {
        System.out.println("查找图书...");
        System.out.println("请输入你要查找的图书的名字:");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        for (int i = 0; i < booklist.getUsesize(); i++) {
            Book book=booklist.getBooks(i);
            if(book.getName().equals(name)){
                System.out.println("找到了");
                System.out.println(book);
                return ;
            }
        }
        System.out.println("未找到此书");
        return ;
    }
}
